using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._TransitFeed
{
    /// <summary>
    /// <para>Generate Shapes Features From GTFS</para>
    /// <para>Generates an estimate of the paths traveled by the vehicles in a public transit system. The output from this tool can be used to generate a new shapes.txt file for a GTFS public transit dataset.</para>
    /// <para>生成公共交通系统中车辆行驶路径的估计值。此工具的输出可用于为 GTFS 公共交通数据集生成新的shapes.txt文件。</para>
    /// </summary>    
    [DisplayName("Generate Shapes Features From GTFS")]
    public class GenerateShapesFeaturesFromGTFS : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GenerateShapesFeaturesFromGTFS()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_gtfs_folder">
        /// <para>Input GTFS Folder</para>
        /// <para>A folder containing a valid GTFS dataset for which you want to create a shapes.txt file. The folder must contain the GTFS stops.txt, trips.txt, routes.txt, and stop_times.txt files.</para>
        /// <para>包含要为其创建shapes.txt文件的有效 GTFS 数据集的文件夹。该文件夹必须包含 GTFS stops.txt、trips.txt、routes.txt 和 stop_times.txt 文件。</para>
        /// </param>
        /// <param name="_out_shape_lines">
        /// <para>Output Transit Shape Lines</para>
        /// <para>A line feature class representing the estimated route shapes calculated by this tool. Each line in the output represents a unique shape required for this GTFS dataset. You can edit the line geometry and use this feature class as input to the Features To GTFS Shapes tool.</para>
        /// <para>表示此工具计算的估计路径形状的线要素类。输出中的每一行都表示此 GTFS 数据集所需的唯一形状。您可以编辑线几何，并将此要素类用作要素转 GTFS 形状工具的输入。</para>
        /// </param>
        /// <param name="_out_shape_stops">
        /// <para>Output Shape Stops</para>
        /// <para><xdoc>
        ///   <para>A point feature class of GTFS transit stops with an ID associating them with each shape line to be created by the tool. In cases where the same GTFS stop is visited by multiple shapes, this feature class will contain multiple copies of that stop, one for each shape with which it is associated. This feature class is useful with definition queries when editing one shape line at a time. Use this feature class as input to the Features To GTFS Shapes tool.</para>
        ///   <para>This output feature class is not equivalent to the output of the GTFS Stops To Features tool. That tool produces a feature class of your GTFS stops exactly as they are in the original dataset, whereas this tool may produce multiple copies of each stop to associate them with different shapes. This output feature class is intended to be used only in conjunction with the other outputs of the Generate Shapes Features From GTFS tool to create a shapes.txt file.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>GTFS 交通停靠点的点要素类具有一个 ID，用于将其与工具要创建的每条形状线相关联。如果多个形状访问同一 GTFS 停靠点，则此要素类将包含该停靠点的多个副本，每个副本对应与其关联的每个形状。此要素类在一次编辑一条形状线时可用于定义查询。使用此要素类作为要素转 GTFS 形状工具的输入。</para>
        ///   <para>此输出要素类不等效于 GTFS 停靠点至要素工具的输出。该工具生成的 GTFS 停靠点的要素类与原始数据集中的要素类完全相同，而此工具可能会生成每个停靠点的多个副本，以便将其与不同的形状相关联。此输出要素类只能与从 GTFS 生成形状要素工具的其他输出结合使用以创建shapes.txt文件。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_gtfs_trips">
        /// <para>Output GTFS Trips</para>
        /// <para>The output GTFS trips.txt file. This file will be equivalent to the trips.txt file in the input GTFS folder but will include the shape_id field added and populated with values corresponding to the shape_id field in the Output Transit Shape Lines feature class.</para>
        /// <para>输出 GTFS trips.txt文件。此文件将等同于输入 GTFS 文件夹中的 trips.txt 文件，但将包括添加的 shape_id 字段，并填充了与输出交通形状线要素类中的 shape_id 字段相对应的值。</para>
        /// </param>
        public GenerateShapesFeaturesFromGTFS(object _in_gtfs_folder, object _out_shape_lines, object _out_shape_stops, object _out_gtfs_trips)
        {
            this._in_gtfs_folder = _in_gtfs_folder;
            this._out_shape_lines = _out_shape_lines;
            this._out_shape_stops = _out_shape_stops;
            this._out_gtfs_trips = _out_gtfs_trips;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Generate Shapes Features From GTFS";

        public override string CallName => "conversion.GenerateShapesFeaturesFromGTFS";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_gtfs_folder, _out_shape_lines, _out_shape_stops, _out_gtfs_trips, _network_modes, _network_data_source, _travel_mode, _drive_side.GetGPValue(), _bearing_tolerance, _max_bearing_angle];

        /// <summary>
        /// <para>Input GTFS Folder</para>
        /// <para>A folder containing a valid GTFS dataset for which you want to create a shapes.txt file. The folder must contain the GTFS stops.txt, trips.txt, routes.txt, and stop_times.txt files.</para>
        /// <para>包含要为其创建shapes.txt文件的有效 GTFS 数据集的文件夹。该文件夹必须包含 GTFS stops.txt、trips.txt、routes.txt 和 stop_times.txt 文件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input GTFS Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_gtfs_folder { get; set; }


        /// <summary>
        /// <para>Output Transit Shape Lines</para>
        /// <para>A line feature class representing the estimated route shapes calculated by this tool. Each line in the output represents a unique shape required for this GTFS dataset. You can edit the line geometry and use this feature class as input to the Features To GTFS Shapes tool.</para>
        /// <para>表示此工具计算的估计路径形状的线要素类。输出中的每一行都表示此 GTFS 数据集所需的唯一形状。您可以编辑线几何，并将此要素类用作要素转 GTFS 形状工具的输入。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Transit Shape Lines")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_shape_lines { get; set; }


        /// <summary>
        /// <para>Output Shape Stops</para>
        /// <para><xdoc>
        ///   <para>A point feature class of GTFS transit stops with an ID associating them with each shape line to be created by the tool. In cases where the same GTFS stop is visited by multiple shapes, this feature class will contain multiple copies of that stop, one for each shape with which it is associated. This feature class is useful with definition queries when editing one shape line at a time. Use this feature class as input to the Features To GTFS Shapes tool.</para>
        ///   <para>This output feature class is not equivalent to the output of the GTFS Stops To Features tool. That tool produces a feature class of your GTFS stops exactly as they are in the original dataset, whereas this tool may produce multiple copies of each stop to associate them with different shapes. This output feature class is intended to be used only in conjunction with the other outputs of the Generate Shapes Features From GTFS tool to create a shapes.txt file.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>GTFS 交通停靠点的点要素类具有一个 ID，用于将其与工具要创建的每条形状线相关联。如果多个形状访问同一 GTFS 停靠点，则此要素类将包含该停靠点的多个副本，每个副本对应与其关联的每个形状。此要素类在一次编辑一条形状线时可用于定义查询。使用此要素类作为要素转 GTFS 形状工具的输入。</para>
        ///   <para>此输出要素类不等效于 GTFS 停靠点至要素工具的输出。该工具生成的 GTFS 停靠点的要素类与原始数据集中的要素类完全相同，而此工具可能会生成每个停靠点的多个副本，以便将其与不同的形状相关联。此输出要素类只能与从 GTFS 生成形状要素工具的其他输出结合使用以创建shapes.txt文件。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Shape Stops")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_shape_stops { get; set; }


        /// <summary>
        /// <para>Output GTFS Trips</para>
        /// <para>The output GTFS trips.txt file. This file will be equivalent to the trips.txt file in the input GTFS folder but will include the shape_id field added and populated with values corresponding to the shape_id field in the Output Transit Shape Lines feature class.</para>
        /// <para>输出 GTFS trips.txt文件。此文件将等同于输入 GTFS 文件夹中的 trips.txt 文件，但将包括添加的 shape_id 字段，并填充了与输出交通形状线要素类中的 shape_id 字段相对应的值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output GTFS Trips")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_gtfs_trips { get; set; }


        /// <summary>
        /// <para>Transit Modes for Network</para>
        /// <para><xdoc>
        ///   <para>Specifies the modes of transit for which line shapes will be generated along the road network rather than with straight lines. Shapes for all modes not selected will be generated using straight lines.</para>
        ///   <para>You should typically select modes that run on streets, such as buses, since those modes are most accurately represented by the road network. Do not select modes that are not modeled by your road network. For example, unless your network explicitly models ferry lanes, don't use the network to represent the paths traveled by ferries.</para>
        ///   <para>The modes are specified using the codes in the table below. These correspond to the valid GTFS routes.txt route_type values from the GTFS documentation.</para>
        ///   <para>Modes 3, 5, and 11 are used by default.</para>
        ///   <bulletList>
        ///     <bullet_item>Tram, streetcar, light rail (GTFS 0)— Tram, streetcar, light rail. This mode corresponds to GTFS route_type 0.</bullet_item><para/>
        ///     <bullet_item>Subway, metro (GTFS 1)— Subway or metro. This mode corresponds to GTFS route_type 1.</bullet_item><para/>
        ///     <bullet_item>Rail (GTFS 2)— Rail. This mode corresponds to GTFS route_type 2.</bullet_item><para/>
        ///     <bullet_item>Bus (GTFS 3)— Bus. This mode corresponds to GTFS route_type 3.</bullet_item><para/>
        ///     <bullet_item>Ferry (GTFS 4)— Ferry. This mode corresponds to GTFS route_type 4.</bullet_item><para/>
        ///     <bullet_item>Cable tram (GTFS 5)— Cable tram. This mode corresponds to GTFS route_type 5.</bullet_item><para/>
        ///     <bullet_item>Aerial lift, suspended cable car, gondola lift, aerial tramway (GTFS 6)— Aerial lift, suspended cable car, gondola lift, aerial tramway. This mode corresponds to GTFS route_type 6.</bullet_item><para/>
        ///     <bullet_item>Funicular (GTFS 7)— Funicular. This mode corresponds to GTFS route_type 7.</bullet_item><para/>
        ///     <bullet_item>Trolleybus (GTFS 11)— Trolleybus. This mode corresponds to GTFS route_type 11.</bullet_item><para/>
        ///     <bullet_item>Monorail (GTFS 12)— Monorail. This mode corresponds to GTFS route_type 12.</bullet_item><para/>
        ///     <bullet_item>Other transit mode—Any mode of public transit not encompassed by the other options.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将沿道路网络生成线形而不是直线形状的交通方式。所有未选择的模式的形状将使用直线生成。</para>
        ///   <para>通常应选择在街道上运行的模式，例如公共汽车，因为这些模式最准确地表示为道路网络。请勿选择未由道路网络建模的模式。例如，除非您的网络显式模拟了渡轮航线，否则请勿使用网络来表示渡轮行驶的路径。</para>
        ///   <para>使用下表中的代码指定模式。这些值对应于 GTFS 文档中的有效 GTFS routes.txt route_type值。</para>
        ///   <para>默认情况下使用模式 3、5 和 11。</para>
        ///   <bulletList>
        ///     <bullet_item>有轨电车、有轨电车、轻轨 （GTFS 0）— 有轨电车、有轨电车、轻轨。此模式对应于 GTFS route_type 0。</bullet_item><para/>
        ///     <bullet_item>地铁、地铁 （GTFS 1）— 地铁或地铁。此模式对应于 GTFS route_type 1。</bullet_item><para/>
        ///     <bullet_item>Rail （GTFS 2）— 铁路。此模式对应于 GTFS route_type 2。</bullet_item><para/>
        ///     <bullet_item>巴士 （GTFS 3）— 巴士。此模式对应于 GTFS route_type 3。</bullet_item><para/>
        ///     <bullet_item>渡轮 （GTFS 4）— 渡轮。此模式对应于 GTFS route_type 4。</bullet_item><para/>
        ///     <bullet_item>有轨电车 （GTFS 5）— 有轨电车。此模式对应于 GTFS route_type 5。</bullet_item><para/>
        ///     <bullet_item>空中缆车、吊索车、缆车、空中缆车 （GTFS 6）— 空中缆车、悬挂缆车、缆车、空中缆车。此模式对应于 GTFS route_type 6。</bullet_item><para/>
        ///     <bullet_item>缆车 （GTFS 7）— 缆车。此模式对应于 GTFS route_type 7。</bullet_item><para/>
        ///     <bullet_item>无轨电车 （GTFS 11）— 无轨电车。此模式对应于 GTFS route_type 11。</bullet_item><para/>
        ///     <bullet_item>单轨电车 （GTFS 12）— 单轨电车。此模式对应于 GTFS route_type 12。</bullet_item><para/>
        ///     <bullet_item>其他交通方式 - 其他选项未包含的任何公共交通方式。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Transit Modes for Network")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _network_modes { get; set; } = null;


        /// <summary>
        /// <para>Network Data Source</para>
        /// <para><xdoc>
        ///   <para>The network dataset or service that will be used for calculating route shapes along a road network. You can use a catalog path to a network dataset, a network dataset layer object, the string name of the network dataset layer, or a portal URL for a network analysis service. The network must have at least one travel mode.</para>
        ///   <para>To use a portal URL, you must be signed in to the portal with an account that has routing privileges.</para>
        ///   <para>Running the tool will consume credits if you use ArcGIS Online as the network data source.</para>
        ///   <para>This parameter is required when any network modes are selected.</para>
        ///   <para>The network dataset you choose should be appropriate for modeling transit vehicles, such as buses, driving on streets. Don't use a network dataset configured to use public transit data with the Public Transit evaluator because this type of network models passengers riding on public transit, not public transit vehicles driving on streets.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于计算沿道路网络的路径形状的网络数据集或服务。您可以使用网络数据集的目录路径、网络数据集图层对象、网络数据集图层的字符串名称或网络分析服务的门户 URL。网络必须至少具有一种出行模式。</para>
        ///   <para>要使用门户 URL，您必须使用具有路由权限的帐户登录到门户。</para>
        ///   <para>如果使用 ArcGIS Online 作为网络数据源，则运行该工具将消耗配额。</para>
        ///   <para>选择任何网络模式时，此参数是必需的。</para>
        ///   <para>您选择的网络数据集应适用于对在街道上行驶的公交车辆（例如公共汽车）进行建模。请勿将配置为将公共交通数据与公共交通评估器配合使用的网络数据集，因为此类网络对乘坐公共交通的乘客进行建模，而不是对在街道上行驶的公共交通车辆进行建模。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Network Data Source")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _network_data_source { get; set; } = null;


        /// <summary>
        /// <para>Travel Mode</para>
        /// <para><xdoc>
        ///   <para>The travel mode on the network data source to use when calculating route shapes along a road network. You can specify the travel mode as a string name of the travel mode or as an arcpy.nax.TravelMode object.</para>
        ///   <para>Use the travel mode most appropriate for modeling vehicles in your transit system driving along the road network.</para>
        ///   <para>This parameter is required when any network modes are selected.</para>
        ///   <para>Do not use a travel mode with an impedance attribute that uses the Public Transit evaluator because that travel mode models passengers riding on public transit, not transit vehicles driving on streets.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>沿道路网络计算路径形状时要使用的网络数据源上的出行模式。可以将出行模式指定为出行模式的字符串名称或 arcpy.nax.TravelMode 对象。</para>
        ///   <para>使用最适合对交通系统中沿道路网络行驶的车辆进行建模的出行模式。</para>
        ///   <para>选择任何网络模式时，此参数是必需的。</para>
        ///   <para>请勿使用具有阻抗属性且使用公共交通评估器的出行模式，因为该出行模式模拟的是乘坐公共交通工具的乘客，而不是在街道上行驶的公交车辆。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Travel Mode")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _travel_mode { get; set; } = null;


        /// <summary>
        /// <para>Side of Road on which Vehicles Drive</para>
        /// <para><xdoc>
        ///   <para>Specifies the side of the road on which vehicles drive in your transit system. This is used to ensure that stops are visited on the correct side of the road.</para>
        ///   <bulletList>
        ///     <bullet_item>Left—Vehicles drive on the left side of the road.</bullet_item><para/>
        ///     <bullet_item>Right—Vehicles drive on the right side of the road. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定车辆在交通系统中行驶的路侧。这用于确保在正确的道路一侧访问停靠点。</para>
        ///   <bulletList>
        ///     <bullet_item>左侧 - 车辆在道路左侧行驶。</bullet_item><para/>
        ///     <bullet_item>右 - 车辆在道路右侧行驶。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Side of Road on which Vehicles Drive")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _drive_side_value _drive_side { get; set; } = _drive_side_value._RIGHT;

        public enum _drive_side_value
        {
            /// <summary>
            /// <para>Left</para>
            /// <para>Left—Vehicles drive on the left side of the road.</para>
            /// <para>左侧 - 车辆在道路左侧行驶。</para>
            /// </summary>
            [Description("Left")]
            [GPEnumValue("LEFT")]
            _LEFT,

            /// <summary>
            /// <para>Right</para>
            /// <para>Right—Vehicles drive on the right side of the road. This is the default.</para>
            /// <para>右 - 车辆在道路右侧行驶。这是默认设置。</para>
            /// </summary>
            [Description("Right")]
            [GPEnumValue("RIGHT")]
            _RIGHT,

        }

        /// <summary>
        /// <para>Bearing Tolerance</para>
        /// <para><xdoc>
        ///   <para>When calculating route shapes along a road network, bearing and bearing tolerance are used to more accurately locate transit stops along the road network. The transit vehicle's bearing is estimated at each stop based on the angles between the current stop and the previous and next stops along the transit route.</para>
        ///   <para>The value specified in this parameter indicates the maximum allowed angle between a transit vehicle's estimated direction of travel at a stop and the angle of the network edge the stop could locate on. If the angles differ by more than this value, Network Analyst assumes that this is not the correct network edge on which to locate the stop, and it will continue searching other nearby network edges for a more appropriate one.</para>
        ///   <para>Specify the value in units of degrees between 0 and 180. The default is 30.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在计算沿道路网络的路径形状时，使用方位角和方位公差来更准确地定位道路网络沿线的公交停靠点。根据当前停靠点与沿运输路线的上一站和下一站之间的角度，估计每个停靠点处的运输车辆方位角。</para>
        ///   <para>此参数中指定的值表示运输车辆在停靠点处的估计行驶方向与停靠点可以定位的网络边的角度之间的最大允许角度。如果角度相差超过此值，则 Network Analyst 将假定这不是定位停靠点的正确网络边，并将继续搜索附近的其他网络边以查找更合适的边。</para>
        ///   <para>以 0 到 180 之间的度为单位指定值。默认值为 30。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Bearing Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _bearing_tolerance { get; set; } = 30;


        /// <summary>
        /// <para>Maximum Bearing Angle Difference</para>
        /// <para><xdoc>
        ///   <para>The transit vehicle's bearing is estimated at each stop based on the angles between the current stop and the previous and next stops along the transit route. When the transit route follows a relatively straight road, this angle is a good representation of the bearing. However, if the route goes around a corner, makes a U-turn, follows a twisty road, or diverts into a parking lot or side road, the average angle is not a good estimate of actual bearing and using this estimate can cause the stop to locate on the network far away from where it should and worsen the quality of the tool output.</para>
        ///   <para>The tool will ignore the bearing estimate if the difference in angle from the previous stop to the current stop and the current stop to the next stop is greater than the value specified in this parameter. In this situation, the stop will revert to the normal network locating behavior and will snap to the closest nonrestricted network edge.</para>
        ///   <para>Specify the value in units of degrees between 0 and 180. The default is 65.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>根据当前停靠点与沿运输路线的上一站和下一站之间的角度，估计每个停靠点处的运输车辆方位角。当运输路线沿着相对笔直的道路行驶时，这个角度可以很好地表示方位角。但是，如果路线绕过拐角、掉头、沿着曲折的道路行驶或改道进入停车场或小路，则平均角度不是实际方位角的良好估计值，使用此估计值可能会导致停靠点在网络上的位置远离其应有的位置，并降低工具输出的质量。</para>
        ///   <para>如果从上一个停止点到当前停止点以及当前停止点到下一个停止点的角度差大于此参数中指定的值，则工具将忽略方位角估计值。在这种情况下，停止将恢复为正常的网络定位行为，并将捕捉到最近的非受限网络边缘。</para>
        ///   <para>以 0 到 180 之间的度为单位指定值。默认值为 65。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Bearing Angle Difference")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _max_bearing_angle { get; set; } = 65;


        public GenerateShapesFeaturesFromGTFS SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}